<?php
require __DIR__ . '/../bootstrap.php';

$em = require __DIR__ . '/../example/em.php';

//$groups = $em->getRepository("\Entity\Group")->findAll();
$groups = $em->getRepository("\Entity\Group")->getAllWithoutNames(array("Смартсим"));

$result = array();

foreach ($groups as $group) {
    $result[] = array('value' => $group->getId(), 'text' => $group->getName());
}

echo json_encode($result);